<template>
  <div class="header">
    <div class="header-left">
      <span class="iconfont back-icon">&#xe682;</span>
    </div>
    <div class="header-input">
      <span class="iconfont">&#xe650;</span>输入城市/景点/游玩主题
    </div>
    <router-link to="/city">
      <div class="header-right">
        {{ this.city }}
        <span class="iconfont arrow-icon">&#xe6aa;</span>
      </div>
    </router-link>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  data() {
    return {
      name: "HomeHeader"
    };
  },
  computed: {
    ...mapState(["city"])
  }
};
</script>

<style lang="stylus" scoped>
@import '~@/assets/styles/varibles.styl'

// 1rem = html font-size = 50px
.header {
  display: flex
  line-height: 0.86rem // 设计师给的是 2 倍的 量得尺寸为 86px 所以应该 43px  换算为 rem 为 .86rem
  background-color: $bgColor
  color: #fff
  .header-left {
    width: 0.64rem
    float: left
    text-align: center
    .back-icon {
      font-size: 0.4rem
    }
  }
  .header-input {
    flex: 1
    background-color: #fff
    border-radius: 0.1rem
    margin-top: 0.12rem
    height: 0.64rem
    line-height: 0.64rem
    margin-left: 0.2rem
    padding-left: 0.1rem
    color: #ccc
  }
  .header-right {
    min-width: 1.04rem
    padding: 0 0.1rem
    float: right
    text-align: center
    color: #fff
    .arrow-icon {
      font-size: 0.34rem
      position: relative
      left: -0.08rem
      top: 0.04rem
      // text-align: center
    }
  }
}
</style>
